﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration.Conventions;
using System.Data.Entity.Infrastructure;

namespace QuoteDAL.DB
{
    public class DBManager : DbContext
    {
        private readonly static string CONNECTION_STRING = "name=ContentString";

        public DbSet<Quote.Stock> Stocks { get; set; }

        public DbSet<Quote.Quote> Quotes { get; set; }

        public DbSet<Quote.QuoteSummary> QuoteSummarys { get; set; }


        public DBManager() : base(CONNECTION_STRING) { }
        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();//移除复数表名的契约      
            modelBuilder.Conventions.Remove<IncludeMetadataConvention>();//防止黑幕交易 要不然每次都要访问 EdmMetadata这个表                 
        }
    }
}
